package com.baor.controller;

import com.baor.domain.ManageVo;
import com.baor.service.ManagerService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.SQLException;
import java.util.List;


@RestController
@RequestMapping("/manager")
public class ManagerController {

    @Autowired
    private ManagerService manageService;

    @RequestMapping("/managerList")
    public AjaxResult<?> managerList(@RequestBody ManageVo vo){
        return manageService.managerList(vo);
    }

    @RequestMapping("/insert")
    public AjaxResult<?> insert(@RequestBody ManageVo manageVo){
        return manageService.insert(manageVo);
    }

    @RequestMapping("/update")
    public AjaxResult<?> update(@RequestBody ManageVo manageVo){
        return manageService.update(manageVo);
    }

    @RequestMapping("/delete")
    public AjaxResult<?> delete(@RequestBody ManageVo manageVo){
        return manageService.delete(manageVo.getManageId());
    }

    @RequestMapping("/info")
    public AjaxResult<?> info(@RequestBody ManageVo manageVo){
        return manageService.info(manageVo.getManageId());
    }


    @RequestMapping("/search")
    public AjaxResult<?> search(@RequestBody ManageVo manageVo){
        return manageService.search(manageVo);
    }

    @RequestMapping("/getData")
    public AjaxResult<?> getData(@RequestBody List<Integer> list) throws SQLException {
        return manageService.getData(list);
    }


}
